import { fileURLToPath, URL } from "node:url";

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: [
      {
        find: "@",
        replacement: fileURLToPath(new URL("./src", import.meta.url)),
      },
    ],
    extensions: [".js", ".jsx", ".ts", ".tsx"],
  },
  base: "./",
  server: {
    port: 8080,
    host: "0.0.0.0",
  },
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
      },
      css: {},
    },
  },
  build: {
    outDir: "dist",
    minify: true,
    sourcemap: true,
    rollupOptions: {
      // input: {},
      // output: {},
      // plugins: []
    }
  },
});
